package com.b.dao;

import com.b.domain.UserAuth;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface UserAuthMapper {
    /**
     * delete by primary key
     *
     * @param userId primaryKey
     * @return deleteCount
     */
    int deleteByPrimaryKey(Integer userId);

    /**
     * insert record to table
     *
     * @param record the record
     * @return insert count
     */
    int insert(UserAuth record);

    /**
     * insert record to table selective
     *
     * @param record the record
     * @return insert count
     */
    int insertSelective(UserAuth record);

    /**
     * select by primary key
     *
     * @param userId primary key
     * @return object by primary key
     */
    UserAuth selectByPrimaryKey(Integer userId);

    /**
     * update record selective
     *
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKeySelective(UserAuth record);

    /**
     * update record
     *
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKey(UserAuth record);

    @Select("select * from user_auth where phone like concat('%',#{phone},'%')")
    List<UserAuth> userList(String phone);

    @Select("select * from user_auth")
    List<UserAuth> getAll();

    @Select("select * from user_auth")
    List<UserAuth> findAll();

    @Select("select * from user_auth where phone = #{phone}")
    UserAuth findUserAuthByPhone(String phone);
}